package com.nbgroup.mapper;

import com.nbgroup.pojo.Role;
import com.nbgroup.pojo.User;
import com.nbgroup.pojo.dto.UserDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SystemMapper {

    /**
     * 查询用户
     */
    List<User> queryUser(UserDTO dto);

    void addUser(User user);

    /**
     *查询角色
     */
    @Select("select * from role;")
    List<Role> queryAllRole();

    /**
     *根据id查询用户
     */
    @Select("select * from user where user_id=#{id};")
    User genInfoUser(Integer id);

    /**
     * 修改用户
     */
    void updateUser(User user);

    /**
     * 删除用户
     */
    @Delete("delete from user where user_id=#{id}")
    void deleteUser(Integer id);

    /**
     * 重置密码
     */
    void resetPwd(User user);

    /**
     * 用户数据导出
     * @param num
     * @param num1
     * @return
     */
    @Select("select * from user limit #{num},#{num1}")
    List<User> userExport(int num, int num1);
}


